﻿using DotNetCommon.Data;
using DotNetCommon.Extensions;
using MicroScheduleServer.Dtos;
using MicroScheduleServer.Services;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Concurrent;

namespace MicroScheduleServer.Controllers
{
    public class ScheduleController : BaseController
    {
        private readonly JobService jobService;

        public ScheduleController(JobService jobService)
        {
            this.jobService = jobService;
        }

        [HttpPost]
        public async Task<Result<string>> CreateJob([FromBody] CreateJobReq req)
        {
            return await this.jobService.CreateJob(req);            
        }

        [HttpGet]
        public async Task<Result> DeleteJob([FromQuery] string guid)
        {
            return Result.Ok().SetMessage("删除成功");
        }

        [HttpGet]
        public async Task<Result<List<JobDto>>> GetList()
        {
            return Result.Ok(new List<JobDto>());
        }
    }
}
